import request from '@/utils/request';

// 巡检项目
export function getPatrolItem(data) {
  return request({
    url: '/park/patrolItem/listAll',
    method: 'get',
    data,
    isJson: true,
  });
}

// 巡检周期
export function getPatrolPlanCycle(data) {
  return request({
    url: '/system/dict/data/type/patrol_plan_cycle',
    method: 'get',
    data,
    isJson: true,
  });
}

// 巡检计划提交
export function netPatrolPlan(data) {
  return request({
    url: '/park/patrolPlan',
    method: 'post',
    data,
    isJson: true,
  });
}

// 巡检记录列表
export function getPatrolRecordList(data) {
  return request({
    url: '/park/patrolRecord/list',
    method: 'get',
    data,
    isJson: false,
  });
}

// 巡检记录详情
export function getPatrolRecord(data) {
  return request({
    url: '/park/patrolRecord/' + data,
    method: 'get',
    isJson: true,
  });
}

// 编辑巡检记录
export function editPatrolRecord(data) {
  return request({
    url: '/park/patrolRecord',
    method: 'put',
    data,
    isJson: true,
  });
}

// 巡检记录明细列表
export function getPatrolRecordDetailList(data) {
  return request({
    url: '/park/patrolRecordDetail/list',
    method: 'get',
    data,
    isJson: true,
  });
}

// 编辑巡检记录明细
export function editPatrolRecordDetail(data) {
  return request({
    url: '/park/patrolRecordDetail',
    method: 'post',
    data,
    isJson: true,
  });
}

// 巡检记录明细的附件列表
export function getPatrolRecordDetailAttachmentList(data) {
  return request({
    url: '/park/patrolRecordDetailAttachment/list',
    method: 'get',
    data,
    isJson: true,
  });
}

// 编辑巡检记录明细的附件
export function editPatrolRecordDetailAttachment(data) {
  return request({
    url: '/park/patrolRecordDetailAttachment',
    method: 'post',
    data,
    isJson: true,
  });
}

// 删除巡检记录明细的附件
export function delPatrolRecordDetailAttachment(data) {
  return request({
    url: '/park/patrolRecordDetailAttachment/' + data,
    method: 'delete',
    isJson: true,
  });
}

// 巡更记录
export function getRoundsRecordList(data) {
  return request({
    url: '/park/roundsRecord/list',
    method: 'get',
    data,
    isJson: true,
  });
}

// 巡更打卡，扫码流程，会获取spaceId
export function netRoundsCheck(data) {
  return request({
    url: '/park/roundsRecordDetail/xcxDaka',
    method: 'put',
    data,
    isJson: true,
  });
}

// 巡检打卡，扫码流程，会获取spaceId
export function xunjiandaka(data) {
  return request({
    url: '/park/patrolRecordDetail/daka',
    method: 'put',
    data,
    isJson: true,
  });
}

// 巡检任务获取
export function planList() {
  return request({
    url: '/park/patrolPlan/planList',
    method: 'get',
    isJson: true,
  });
}
